package com.nygym.service.impl;

import com.nygym.mapper.GymEquipmentMapper;
import com.nygym.domain.Equipment;
import com.nygym.service.IEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 器材Service业务层处理
 * 
 * @author XJKloveNy
 * @date 2022-12-04
 */
@Service
public class GymEquipmentServiceImpl implements IEquipmentService
{
    @Autowired
    private GymEquipmentMapper gymEquipmentMapper;

    /**
     * 查询器材
     * 
     * @param id 器材主键
     * @return 器材
     */
    @Override
    public Equipment selectEquipmentById(Long id)
    {
        return gymEquipmentMapper.selectEquipmentById(id);
    }

    /**
     * 查询器材列表
     * 
     * @param equipment 器材
     * @return 器材
     */
    @Override
    public List<Equipment> selectEquipmentList(Equipment equipment)
    {
        return gymEquipmentMapper.selectEquipmentList(equipment);
    }

    /**
     * 新增器材
     * 
     * @param equipment 器材
     * @return 结果
     */
    @Override
    public int insertEquipment(Equipment equipment)
    {
        return gymEquipmentMapper.insertEquipment(equipment);
    }

    /**
     * 修改器材
     * 
     * @param equipment 器材
     * @return 结果
     */
    @Override
    public int updateEquipment(Equipment equipment)
    {
        return gymEquipmentMapper.updateEquipment(equipment);
    }

    /**
     * 批量删除器材
     * 
     * @param ids 需要删除的器材主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentByIds(Long[] ids)
    {
        return gymEquipmentMapper.deleteEquipmentByIds(ids);
    }

    /**
     * 删除器材信息
     * 
     * @param id 器材主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentById(Long id)
    {
        return gymEquipmentMapper.deleteEquipmentById(id);
    }
}
